﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true"
    CodeFile="SendPort.aspx.cs" Inherits="BTOps_SendPort" Title="BizTalk Server Administration Web Console - Send Ports"
    StylesheetTheme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Label ID="lblPageHeader" runat="server" CssClass="PageHeader" Text="Send Ports" /><br />
    <br />
    <strong>Applications:</strong>
    <asp:DropDownList ID="ddlApps" runat="server" AutoPostBack="True" DataSourceID="ApplicationDS"
        DataTextField="Name" DataValueField="Name" AppendDataBoundItems="True" OnDataBound="ddlApps_DataBound">
        <asp:ListItem Text="Select..." Value="" />
    </asp:DropDownList>
    <asp:Panel ID="pnlSendPortInfo" runat="server" Visible="false">
        <br />
        <br />
        <asp:GridView ID="grdSendPorts" runat="server" EmptyDataText="No send ports found..."
            AutoGenerateColumns="False" EnableViewState="False" DataSourceID="SendPortDS"
            DataKeyNames="Name">
            <Columns>
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="SelectLinkButton" runat="server" CausesValidation="False" CommandName="Select"
                            Text="Select" />&nbsp;
                        <asp:LinkButton ID="DeleteLinkButton" runat="server" CausesValidation="False" CommandName="Delete"
                            Text="Delete" OnClientClick="return confirm('Do you really want to delete this send port?');" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Name" HeaderText="Name" />
                <asp:BoundField DataField="TransportType" HeaderText="Adapter" />
                <asp:BoundField DataField="Address" HeaderText="Destination Address" />
                <asp:BoundField DataField="SendPipelineName" HeaderText="Send Pipeline" />
            </Columns>
        </asp:GridView>
    </asp:Panel>
    <asp:Panel ID="pnlSendPortDetail" runat="server" Visible="false">
        <br />
        <br />
        <asp:Label ID="lblSendPortDetay" runat="server" CssClass="PageHeader" Text="Send Port Details" /><br />
        <table border="0" cellspacing="0" cellpadding="5">
            <tr>
                <td valign="top">
                    <asp:DetailsView ID="dvwSendPort" runat="server" AutoGenerateRows="False" DataSourceID="SendPortDetailsDS"
                        EnableViewState="False" DataKeyNames="Name" OnDataBound="dvwSendPort_DataBound">
                        <Fields>
                            <asp:TemplateField HeaderText="Name">
                                <ItemTemplate>
                                    <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>' ValidationGroup="SendPort" />
                                    <asp:RequiredFieldValidator ID="NameRequired" runat="server" ControlToValidate="txtName"
                                        Display="Dynamic" ErrorMessage="Send port name is required" ValidationGroup="SendPort">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="txtName" runat="server" ValidationGroup="SendPort" />
                                    <asp:RequiredFieldValidator ID="NameRequired" runat="server" ControlToValidate="txtName"
                                        Display="Dynamic" ErrorMessage="Send port name is required" ValidationGroup="SendPort">*</asp:RequiredFieldValidator>
                                </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Adapter">
                                <ItemTemplate>
                                    <asp:Label ID="lblTransportType" runat="server" Text='<%# Eval("TransportType") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:DropDownList ID="ddlTransportType" runat="server" ValidationGroup="SendPort"
                                        SelectedValue='<%# Bind("TransportType") %>' AutoPostBack="True" OnSelectedIndexChanged="ddlTransportType_SelectedIndexChanged">
                                        <asp:ListItem Value="" Text="Select..." />
                                        <asp:ListItem Value="FILE">FILE</asp:ListItem>
                                        <asp:ListItem Value="FTP">FTP</asp:ListItem>
                                        <asp:ListItem Value="HTTP">HTTP</asp:ListItem>
                                        <asp:ListItem Value="MQSERIES">MQSeries</asp:ListItem>
                                        <asp:ListItem Value="MSMQ">MSMQ</asp:ListItem>
                                        <asp:ListItem Value="POP3">POP3</asp:ListItem>
                                        <asp:ListItem Value="SOAP">SOAP</asp:ListItem>
                                        <asp:ListItem Value="SQL">SQL</asp:ListItem>
                                        <asp:ListItem Value="WSS">WSS</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="TransportTypeRequired" runat="server" ErrorMessage="Select send adapter type"
                                        ValidationGroup="SendPort" ControlToValidate="ddlTransportType" Display="Dynamic"
                                        EnableViewState="False">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:DropDownList ID="ddlTransportType" runat="server" ValidationGroup="SendPort"
                                        AutoPostBack="True" OnSelectedIndexChanged="ddlTransportType_SelectedIndexChanged">
                                        <asp:ListItem Value="" Text="Select..." />
                                        <asp:ListItem Value="FILE">FILE</asp:ListItem>
                                        <asp:ListItem Value="FTP">FTP</asp:ListItem>
                                        <asp:ListItem Value="HTTP">HTTP</asp:ListItem>
                                        <asp:ListItem Value="MQSERIES">MQSeries</asp:ListItem>
                                        <asp:ListItem Value="MSMQ">MSMQ</asp:ListItem>
                                        <asp:ListItem Value="POP3">POP3</asp:ListItem>
                                        <asp:ListItem Value="SOAP">SOAP</asp:ListItem>
                                        <asp:ListItem Value="SQL">SQL</asp:ListItem>
                                        <asp:ListItem Value="WSS">WSS</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="TransportTypeRequired" runat="server" ErrorMessage="Select send adapter type"
                                        ValidationGroup="SendPort" ControlToValidate="ddlTransportType" Display="Dynamic"
                                        EnableViewState="False">*</asp:RequiredFieldValidator>
                                </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Destination Address">
                                <ItemTemplate>
                                    <asp:Label ID="lblAddress" runat="server" Text='<%# Eval("Address") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtAddress" runat="server" Columns="40" TextMode="MultiLine" ValidationGroup="SendPort"
                                        Text='<%# Bind("Address") %>' />
                                    <asp:RequiredFieldValidator ID="AddressRequired" runat="server" ErrorMessage="Destination address is required"
                                        ValidationGroup="SendPort" ControlToValidate="txtAddress" Display="Dynamic" EnableViewState="False">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="txtAddress" runat="server" Columns="40" TextMode="MultiLine" ValidationGroup="SendPort" />
                                    <asp:RequiredFieldValidator ID="AddressRequired" runat="server" ErrorMessage="Destination address is required"
                                        ValidationGroup="SendPort" ControlToValidate="txtAddress" Display="Dynamic" EnableViewState="False">*</asp:RequiredFieldValidator>
                                </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Send Pipeline">
                                <ItemTemplate>
                                    <asp:Label ID="lblSendPipelineName" runat="server" Text='<%# Eval("SendPipelineName") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:DropDownList ID="ddlSendPipeline" runat="server" DataSourceID="PipelineDS" DataTextField="FullName"
                                        DataValueField="FullName" AppendDataBoundItems="True" SelectedValue='<%# Bind("SendPipelineName") %>'
                                        ValidationGroup="SendPort">
                                        <asp:ListItem>Microsoft.BizTalk.DefaultPipelines.PassThruTransmit</asp:ListItem>
                                        <asp:ListItem>Microsoft.BizTalk.DefaultPipelines.XMLTransmit</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="SendPipelineRequired" runat="server" ControlToValidate="ddlSendPipeline"
                                        Display="Dynamic" ErrorMessage="Send pipeline seçiniz" ValidationGroup="SendPort"
                                        EnableViewState="False">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:DropDownList ID="ddlSendPipeline" runat="server" DataSourceID="PipelineDS" DataTextField="FullName"
                                        DataValueField="FullName" AppendDataBoundItems="True" ValidationGroup="SendPort">
                                        <asp:ListItem>Microsoft.BizTalk.DefaultPipelines.PassThruTransmit</asp:ListItem>
                                        <asp:ListItem>Microsoft.BizTalk.DefaultPipelines.XMLTransmit</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="SendPipelineRequired" runat="server" ControlToValidate="ddlSendPipeline"
                                        Display="Dynamic" ErrorMessage="Send pipeline seçiniz" ValidationGroup="SendPort"
                                        EnableViewState="False">*</asp:RequiredFieldValidator>
                                </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Receive Pipeline">
                                <ItemTemplate>
                                    <asp:Label ID="lblReceivePipelineName" runat="server" Text='<%# Eval("ReceivePipelineName") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:DropDownList ID="ddlReceivePipeline" runat="server" DataSourceID="PipelineDS"
                                        DataTextField="FullName" DataValueField="FullName" AppendDataBoundItems="True"
                                        SelectedValue='<%# Bind("ReceivePipelineName") %>'>
                                        <asp:ListItem Value="" Text="Select..." />
                                        <asp:ListItem>Microsoft.BizTalk.DefaultPipelines.PassThruReceive</asp:ListItem>
                                        <asp:ListItem>Microsoft.BizTalk.DefaultPipelines.XMLReceive</asp:ListItem>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:DropDownList ID="ddlReceivePipeline" runat="server" DataSourceID="PipelineDS"
                                        DataTextField="FullName" DataValueField="FullName" AppendDataBoundItems="True">
                                        <asp:ListItem Value="" Text="Select..." />
                                        <asp:ListItem>Microsoft.BizTalk.DefaultPipelines.PassThruReceive</asp:ListItem>
                                        <asp:ListItem>Microsoft.BizTalk.DefaultPipelines.XMLReceive</asp:ListItem>
                                    </asp:DropDownList>
                                </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="SendHandlerName" HeaderText="Send Handler" />
                            <asp:CheckBoxField DataField="TwoWay" HeaderText="Two Way" />
                            <asp:CheckBoxField DataField="IsDynamic" HeaderText="Dynamic" />
                            <asp:CheckBoxField DataField="RouteFailed" HeaderText="Route Failed Messages" />
                            <asp:TemplateField HeaderText="Description">
                                <ItemTemplate>
                                    <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtDescription" runat="server" Columns="40" TextMode="MultiLine"
                                        ValidationGroup="SendPort" Text='<%# Bind("Description") %>' />
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="txtDescription" runat="server" Columns="40" TextMode="MultiLine"
                                        ValidationGroup="SendPort" />
                                </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ShowInsertButton="True" ValidationGroup="SendPort" ShowEditButton="True" />
                        </Fields>
                    </asp:DetailsView>
                </td>
                <td valign="top">
                    <asp:Panel ID="pnlFTPInfo" runat="server" Visible="False">
                        <table border="0" cellpadding="5" cellspacing="1">
                            <tr>
                                <td class="FieldHeader">
                                    Server Address</td>
                                <td class="Row">
                                    <asp:TextBox ID="txtServerAddress" runat="server" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Server Port</td>
                                <td class="AlternatingRow">
                                    <asp:TextBox ID="txtServerPort" runat="server" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    User Name</td>
                                <td class="Row">
                                    <asp:TextBox ID="txtUserName" runat="server" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Password</td>
                                <td class="AlternatingRow">
                                    <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Representation</td>
                                <td class="Row">
                                    <asp:DropDownList ID="ddlRepresentation" runat="server" Enabled="false">
                                        <asp:ListItem>binary</asp:ListItem>
                                        <asp:ListItem>ASCII</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Folder</td>
                                <td class="AlternatingRow">
                                    <asp:TextBox ID="txtFolder" runat="server" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Target File Name</td>
                                <td class="Row">
                                    <asp:TextBox ID="txtTargetFile" runat="server" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Firewall Address</td>
                                <td class="AlternatingRow">
                                    <asp:TextBox ID="txtFirewallAddress" runat="server" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Firewall Port</td>
                                <td class="Row">
                                    <asp:TextBox ID="txtFirewallPort" runat="server" Text="21" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Firewall User</td>
                                <td class="AlternatingRow">
                                    <asp:TextBox ID="txtFirewallUser" runat="server" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Firewall Password</td>
                                <td class="Row">
                                    <asp:TextBox ID="txtFirewallPassword" runat="server" TextMode="Password" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Firewall Type</td>
                                <td class="AlternatingRow">
                                    <asp:DropDownList ID="ddlFirewallType" runat="server" Enabled="false">
                                        <asp:ListItem Value="NoFirewall">None</asp:ListItem>
                                        <asp:ListItem>SOCKS 4</asp:ListItem>
                                        <asp:ListItem>SOCKS 5</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Firewall Mode</td>
                                <td class="Row">
                                    <asp:DropDownList ID="ddlPassiveMode" runat="server" Enabled="false">
                                        <asp:ListItem>Active</asp:ListItem>
                                        <asp:ListItem>Passive</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                    <asp:Panel ID="pnlSQLInfo" runat="server" Visible="False">
                        <table border="0" cellpadding="5" cellspacing="1">
                            <tr>
                                <td class="FieldHeader">
                                    Connection String</td>
                                <td class="Row">
                                    <asp:TextBox ID="txtConnString" runat="server" Columns="50" TextMode="MultiLine"
                                        Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Response Document Root Element Name</td>
                                <td class="AlternatingRow">
                                    <asp:TextBox ID="txtRootElementName" runat="server" Columns="50" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Document Target Namespace</td>
                                <td class="Row">
                                    <asp:TextBox ID="txtTargetNamespace" runat="server" Columns="50" Enabled="false" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                    <asp:Panel ID="pnlFILEInfo" runat="server" Visible="False">
                        <table border="0" cellpadding="5" cellspacing="1">
                            <tr>
                                <td class="FieldHeader">
                                    Directory</td>
                                <td class="Row">
                                    <asp:TextBox ID="txtDirectory" runat="server" Columns="40" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    File Name</td>
                                <td class="AlternatingRow">
                                    <asp:TextBox ID="txtFileName" runat="server" Columns="40" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Copy Mode</td>
                                <td class="Row">
                                    <asp:DropDownList ID="ddlCopyMode" runat="server" Enabled="false">
                                        <asp:ListItem Value="1">Create New</asp:ListItem>
                                        <asp:ListItem Value="0">Append</asp:ListItem>
                                        <asp:ListItem Value="2">Overwrite</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Allow Cache On Write</td>
                                <td class="AlternatingRow">
                                    <asp:CheckBox ID="chkAllowCache" runat="server" Enabled="false" />
                                </td>
                            </tr>
                            <tr>
                                <td class="FieldHeader">
                                    Use Temporary File</td>
                                <td class="Row">
                                    <asp:CheckBox ID="chkUseTemp" runat="server" Enabled="false" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
                <td valign="top">
                    <asp:ValidationSummary ID="ValidationSummary2" runat="server" ValidationGroup="SendPort" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:ObjectDataSource ID="ApplicationDS" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="ListApplicationNames" TypeName="BTApplicationOperations" />
    <asp:ObjectDataSource ID="SendPortDS" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="ListSendPorts" TypeName="BTSendPortOperations" DataObjectTypeName="BTOps.BTSendPort"
        DeleteMethod="DeleteSendPort">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlApps" Name="applicationName" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="PipelineDS" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="ListSendPipelines" TypeName="BTPipelineOperations">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlApps" Name="applicationName" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="SendPortDetailsDS" runat="server" DataObjectTypeName="BTOps.BTSendPort"
        InsertMethod="CreateSendPort" OldValuesParameterFormatString="original_{0}" SelectMethod="SendPortByName"
        TypeName="BTSendPortOperations" UpdateMethod="UpdateSendPort" OnInserting="SendPortDetailsDS_Inserting"
        OnUpdating="SendPortDetailsDS_Updating">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlApps" Name="applicationName" PropertyName="SelectedValue"
                Type="String" />
            <asp:ControlParameter ControlID="grdSendPorts" Name="name" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
